package com.hue.springcloud.controller;

import com.hue.springcloud.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {
    @Autowired
    private StorageService storageService;

    @GetMapping("/storage/update/{productId}/{count}")
    public void updateStorage(@PathVariable("productId")long productId, @PathVariable("count")int count){
        System.out.println(productId+","+count+"---------");
        storageService.updateStorage(count,productId);
    }
}
